package com.lagou.task.service;

import com.lagou.task.dao.StudentDao;
import com.lagou.task.factory.StudentDaoFactory;
import com.lagou.task.model.Student;

import java.util.List;

public class StudentService {
    private StudentDao studentDao;
    public StudentService(){
        this.studentDao = StudentDaoFactory.getStudentDao();
    }
    public int studentAddService(Student student){return studentDao.add(student);}
    public int studentUpdate(String sId,String sName, String sSex, String sBirth, String sEmail, String sNote){
        return studentDao.update(sId,sName,sSex,sBirth,sEmail,sNote);
    }
    public int studentDelete(int sId){
        return studentDao.delete(sId);
    }
    public List<Student> studentSelectAll(){
        return studentDao.selectAll();
    }
    public Student studentsSelectById(String str){
        return studentDao.selectById(str);
    }
}
